package com.atguigu.service.impl;

import com.atguigu.mapper.EmpMapper;
import com.atguigu.pojo.Emp;
import com.atguigu.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: liuaojun
 * @CreateTime: 2025-02-05
 * @Description:
 * @Version: 1.0
 */
@Service
public class EmpServiceImpl implements EmpService {
    @Autowired
    EmpMapper empMapper;


    @Override
    public void insert(Emp emp) {
        empMapper.insertEmp(emp);
    }

    @Override
    public void update(Emp emp) {
        empMapper.updateEmp(emp);
    }

    @Override
    public void delete(Integer eid) {
        empMapper.deleteEmp(eid);
    }

    @Override
    public Emp getEmp(Integer eid) {
        Emp emp = empMapper.selectEmp(eid);
        return emp;
    }

    @Override
    public List<Emp> getAllEmp() {
        List<Emp> empList = empMapper.selectAllEmp();
        return empList;
    }
}
